package com.nice.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class TradeSchema implements Comparable, Serializable {

    public String seqNo;

    //产品
    public String indexName;
    //成交价
    public BigDecimal tradePrice;

    public int lots;

    public int type;

    public BigDecimal profit;

    public Date date;

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public BigDecimal getTradePrice() {
        return tradePrice;
    }

    public void setTradePrice(BigDecimal tradePrice) {
        this.tradePrice = tradePrice;
    }

    public int getLots() {
        return lots;
    }

    public void setLots(int lots) {
        this.lots = lots;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public BigDecimal getProfit() {
        return profit;
    }

    public void setProfit(BigDecimal profit) {
        this.profit = profit;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    @Override
    public String toString() {
        return "TradeSchema{" +
                "indexName='" + indexName + '\'' +
                ", tradePrice=" + tradePrice +
                ", lots=" + lots +
                ", type=" + type +
                ", profit=" + profit +
                ", date=" + date +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        if (o instanceof TradeSchema) {
            TradeSchema tradeSchema = (TradeSchema) o;
            return this.indexName.compareTo(tradeSchema.getIndexName());
        }
        throw new ClassCastException("不能转换为PriceSchema类型的对象...");
    }

}
